﻿using BCEntity.TMS.MarketingCoupon.MarketingCouponReceive;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCData.TMS.MarketingCoupon.MarketingCouponReceive
{
    public interface IMarketingCouponReceiveData
    {
        /// <summary>
        /// 检查优惠券已领取
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="marketingCouponId">优惠券Id</param>
        /// <returns></returns>
        Task<bool> Exsits(long userId,long marketingCouponId);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<MarketingCouponReceiveEntity> InsertAsync(MarketingCouponReceiveEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<MarketingCouponReceiveEntity> UpdateAsync(MarketingCouponReceiveEntity entity);
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="marketingCouponReceiveId"></param>
        /// <returns></returns>
        Task<MarketingCouponReceiveEntity> GetEntityById(long marketingCouponReceiveId);
        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="marketingCouponTypeId">优惠券类型Id</param>
        /// <param name="isInvalid">是否有效</param>
        /// <param name="isUse">是否可以使用</param>
        /// <param name="userId">用户id</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<MarketingCouponReceiveEntity>,int)> Query(long? marketingCouponTypeId, long? userId,bool? isInvalid,
            bool? isUse,int pageIndex,int pageSize);
        /// <summary>
        /// 根据优惠券id获取信息
        /// </summary>
        /// <param name="marketingCouponId"></param>
        /// <returns></returns>
        Task<MarketingCouponReceiveEntity> GetEntityByCouponId(long marketingCouponId);


    }
}
